package main

import (
	"./cardutil"
	"bufio"
	"fmt"
	"os"
	"strings"
)

// https://idol.st/allstars/card/431
// js getSifasCardInfo.js

func main() {

	fmt.Println("请输入 sifas 文件夹地址：")

	scanner := bufio.NewReader(os.Stdin)
	var pathByte, _, _ = scanner.ReadLine()
	pathString := string(pathByte)

	dealMapId := func(id string) string {
		return id[0:strings.IndexByte(id, '-')] + id[strings.LastIndexByte(id, '-')+1:]
	}

	dealPicName := func(name string) string {
		return name[0:strings.IndexByte(name, '-')] + name[strings.LastIndexByte(name, '-')+1:]
	}

	cardutil.ReplaceCardNameByText(pathString+"/card/", pathString+"/name.txt", "~~~", dealMapId, nil, dealPicName)

}
